package com.ldg.crm.dao;

import com.ldg.crm.entity.FollowUpRecordsEntity;
import com.ldg.crm.entity.FollowUpRecordsEntityExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface FollowUpRecordsDao {
    /**
     *
     * @mbg.generated
     */
    @SelectProvider(type=FollowUpRecordsEntitySqlProvider.class, method="countByExample")
    long countByExample(FollowUpRecordsEntityExample example);

    /**
     *
     * @mbg.generated
     */
    @DeleteProvider(type=FollowUpRecordsEntitySqlProvider.class, method="deleteByExample")
    int deleteByExample(FollowUpRecordsEntityExample example);

    /**
     *
     * @mbg.generated
     */
    @Delete({
        "delete from crm_follow_up_records",
        "where records_id = #{recordsId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer recordsId);

    /**
     *
     * @mbg.generated
     */
    @Insert({
        "insert into crm_follow_up_records (records_id, bus_id, ",
        "uid, method, create_time, ",
        "comment, content)",
        "values (#{recordsId,jdbcType=INTEGER}, #{busId,jdbcType=INTEGER}, ",
        "#{uid,jdbcType=INTEGER}, #{method,jdbcType=TINYINT}, #{createTime,jdbcType=DATE}, ",
        "#{comment,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="recordsId", before=true, resultType=Integer.class)
    int insert(FollowUpRecordsEntity record);

    /**
     *
     * @mbg.generated
     */
    @InsertProvider(type=FollowUpRecordsEntitySqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="recordsId", before=true, resultType=Integer.class)
    int insertSelective(FollowUpRecordsEntity record);

    /**
     *
     * @mbg.generated
     */
    @SelectProvider(type=FollowUpRecordsEntitySqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="records_id", property="recordsId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="bus_id", property="busId", jdbcType=JdbcType.INTEGER),
        @Result(column="uid", property="uid", jdbcType=JdbcType.INTEGER),
        @Result(column="method", property="method", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.DATE),
        @Result(column="comment", property="comment", jdbcType=JdbcType.VARCHAR),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<FollowUpRecordsEntity> selectByExampleWithBLOBs(FollowUpRecordsEntityExample example);

    /**
     *
     * @mbg.generated
     */
    @SelectProvider(type=FollowUpRecordsEntitySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="records_id", property="recordsId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="bus_id", property="busId", jdbcType=JdbcType.INTEGER),
        @Result(column="uid", property="uid", jdbcType=JdbcType.INTEGER),
        @Result(column="method", property="method", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.DATE),
        @Result(column="comment", property="comment", jdbcType=JdbcType.VARCHAR)
    })
    List<FollowUpRecordsEntity> selectByExample(FollowUpRecordsEntityExample example);

    /**
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "records_id, bus_id, uid, method, create_time, comment, content",
        "from crm_follow_up_records",
        "where records_id = #{recordsId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="records_id", property="recordsId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="bus_id", property="busId", jdbcType=JdbcType.INTEGER),
        @Result(column="uid", property="uid", jdbcType=JdbcType.INTEGER),
        @Result(column="method", property="method", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.DATE),
        @Result(column="comment", property="comment", jdbcType=JdbcType.VARCHAR),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    FollowUpRecordsEntity selectByPrimaryKey(Integer recordsId);

    /**
     *
     * @mbg.generated
     */
    @UpdateProvider(type=FollowUpRecordsEntitySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") FollowUpRecordsEntity record, @Param("example") FollowUpRecordsEntityExample example);

    /**
     *
     * @mbg.generated
     */
    @UpdateProvider(type=FollowUpRecordsEntitySqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") FollowUpRecordsEntity record, @Param("example") FollowUpRecordsEntityExample example);

    /**
     *
     * @mbg.generated
     */
    @UpdateProvider(type=FollowUpRecordsEntitySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") FollowUpRecordsEntity record, @Param("example") FollowUpRecordsEntityExample example);

    /**
     *
     * @mbg.generated
     */
    @UpdateProvider(type=FollowUpRecordsEntitySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(FollowUpRecordsEntity record);

    /**
     *
     * @mbg.generated
     */
    @Update({
        "update crm_follow_up_records",
        "set bus_id = #{busId,jdbcType=INTEGER},",
          "uid = #{uid,jdbcType=INTEGER},",
          "method = #{method,jdbcType=TINYINT},",
          "create_time = #{createTime,jdbcType=DATE},",
          "comment = #{comment,jdbcType=VARCHAR},",
          "content = #{content,jdbcType=LONGVARCHAR}",
        "where records_id = #{recordsId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(FollowUpRecordsEntity record);

    /**
     *
     * @mbg.generated
     */
    @Update({
        "update crm_follow_up_records",
        "set bus_id = #{busId,jdbcType=INTEGER},",
          "uid = #{uid,jdbcType=INTEGER},",
          "method = #{method,jdbcType=TINYINT},",
          "create_time = #{createTime,jdbcType=DATE},",
          "comment = #{comment,jdbcType=VARCHAR}",
        "where records_id = #{recordsId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(FollowUpRecordsEntity record);
}